/* 
 * File:   main.c
 * Author: diego
 *
 * Created on August 17, 2010, 10:46 PM
 */
#include <stdio.h>
#include <stdlib.h>
#include "lex.yy.h"
#include "symbol_table.h"

extern int running;
extern symbol_table* table;

int main(int argc, char ** argv)
{
    initMe();
    int token;
    yyin = fopen(argv[1], "r");
    while (running) {
        token = yylex();

        /* it prevents print the eof character */
        if (running) {
            printf("Line %d: %s (%d)\n", getLineNumber(), yytext, token);
        }
    }
    fclose(yyin);

    print_symbol_table(*table);
}

